/**
 * 财务管理模块 http 请求
 */
import http from '@/utils/request'

export const gainBillNo = (data) => {
  return http.get('/api/erp/finance/repayment/erpFinanceRepaymentSlip/gainBillNo', data)
}

export const add = (data) => {
  return http.post('/api/erp/finance/repayment/erpFinanceRepaymentSlip/add', data)
}

export const edit = (data) => {
  return http.put('/api/erp/finance/repayment/erpFinanceRepaymentSlip/edit', data)
}

export const info = (data) => {
  return http.get('/api/erp/finance/repayment/erpFinanceRepaymentSlip/queryById', data)
}

export const getChildData = (data) => {
  return http.get('/api/erp/finance/repayment/erpFinanceRepaymentSlipDetail/allList', data)
}


// 新增付款申请
export const financePaymentAdd = (data) => {
  return http.post('/api/erp/finance/payment/erpFinancePaymentSlip/add', data)
}
//  编辑付款申请
export const financePaymentEdit = (data) => {
  return http.put('/api/erp/finance/payment/erpFinancePaymentSlip/edit', data)
}
// 获取付款单号
export const paymentSlipBillNo = (data) => {
  return http.get('/api/erp/finance/payment/erpFinancePaymentSlip/getBillNo', data)
}
// 获取费用报销单号
export const reimburseSlipBillNo = () => {
  return http.get('/api/erp/finance/reimbursement/erpFinanceReimbursementBill/getBillNo', {})
}
// 新建费用报销单
export const feeReimburseAdd = (data) => {
  return http.post('/api/erp/finance/reimbursement/erpFinanceReimbursementBill/add', data)
}
// 查询所有采购大类
export const queryAllParent = (data) => {
  return http.get('/api/erp/purchase/material/erpMaterialCategory/queryAllParent', data)
}
// 根据大类的parentId查询小类
export const queryChildrenByParentId = (data) => {
  return http.get('/api/erp/purchase/material/erpMaterialCategory/queryChildrenByParentId', data)
}

// 获取关联合同信息
export const purchaseContractPayment = (data) => {
  return http.get('/api/erp/purchase/contract/erpPurchaseContractPayment/list', data)
}
// 关联单据---查询付款申请单
export const getFinancePaymentSlipList = (data) => {
  return http.get('/api/erp/finance/payment/erpFinancePaymentSlip/allList', data)
}
/* 根据 billId 查询付款申请单详情*/
export const queryBillInfoByBillId = (data) => {
  return http.get('/api/erp/finance/payment/erpFinancePaymentSlipFeeDetail/queryBillInfoByBillId', data)
}
/* 编辑费用报销单提交 */
export const feeReimburseEdit = (data) => {
  return http.put('/api/erp/finance/reimbursement/erpFinanceReimbursementBill/edit', data)
}